package com.itheima.app.controller;

import com.itheima.app.manager.TanHuaManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TanHuaController {
    @Autowired
    private TanHuaManager tanhuaManager;

    @GetMapping("/tanhua/cards")
    public ResponseEntity findCards(){
        return tanhuaManager.showCards();
    }
    @GetMapping("/tanhua/{id}/love")
    public ResponseEntity love(@PathVariable String id){
        return tanhuaManager.love(id);
    }
    @GetMapping("/tanhua/{id}/unlove")
    public ResponseEntity unlove(@PathVariable String id){
        //System.out.println("打印看一下这是谁的id："+id);
        //id为推荐用户的id 不是当前登陆人的id
        return tanhuaManager.unlove(id);

    }
}
